.talkCard {
  margin-bottom: 24px;
  border-radius: 12px;
  box-shadow: 0 2px 8px var(--shadow-color);
  transition: all 0.3s ease;
  overflow: hidden;
  background-color: var(--bg-primary);
  animation: fade-in-up 0.6s ease-out;
  border: 1px solid var(--border-color);
  
  &:hover {
    box-shadow: 0 4px 16px var(--shadow-color);
    transform: translateY(-2px);
  }
}

.cardHeader {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  
  .avatar {
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    
    &:hover {
      border-color: var(--text-primary);
      transform: scale(1.05);
    }
  }
  
  .userInfo {
    .username {
      font-weight: 600;
      font-size: 14px;  /* 从16px改为14px */
      color: var(--text-primary);
      margin-bottom: 4px;
    }
    
    .time {
      font-size: 12px;
      color: var(--text-secondary);
    }
  }
  
  .deleteBtn {
    opacity: 0;
    transition: all 0.3s ease;
    
    &:hover {
      background: rgba(255, 77, 79, 0.1);
    }
  }
}

.talkCard:hover .deleteBtn {
  opacity: 1;
}

.content {
  margin-bottom: 16px;
  
  .text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 12px;
    white-space: pre-wrap;
    word-break: break-word;
  }
  
  .imageGrid {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    
    // 1张图片
    &:has(.imageWrapper:nth-child(1):last-child) {
      grid-template-columns: 1fr;
      max-width: 400px;
    }
    
    // 2张图片
    &:has(.imageWrapper:nth-child(2):last-child) {
      grid-template-columns: 1fr 1fr;
    }
    
    // 3张图片
    &:has(.imageWrapper:nth-child(3):last-child) {
      grid-template-columns: 1fr 1fr 1fr;
    }
    
    // 4张图片
    &:has(.imageWrapper:nth-child(4):last-child) {
      grid-template-columns: 1fr 1fr;
      grid-template-rows: 1fr 1fr;
    }
    
    // 5张及以上图片
    grid-template-columns: repeat(3, 1fr);
    
    .imageWrapper {
      position: relative;
      aspect-ratio: 2/1; // 将高度改为宽度的一半
      border-radius: 8px;
      overflow: hidden;
      background: #f5f5f5;
      
      .image {
        width: 100%;
        height: 100%;
        object-fit: cover; // 保持图片填满容器并裁剪多余部分
        transition: all 0.3s ease;
        cursor: pointer;
        
        &:hover {
          transform: scale(1.05);
        }
      }
    }
  }
}

.actions {
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
  
  .actionBtn {
    color: #8c8c8c;
    font-size: 14px;
    transition: all 0.3s ease;
    border-radius: 20px;
    padding: 4px 12px;
    
    &:hover {
      background: rgba(24, 144, 255, 0.06);
      color: #1890ff;
      transform: translateY(-1px);
    }
    
    &.liked {
      color: #ff4d4f;
      
      &:hover {
        background: rgba(255, 77, 79, 0.06);
        color: #ff4d4f;
      }
      
      // 点赞时的心跳动画
      &.heartbeat {
        animation: heart-beat 0.6s ease-in-out;
      }
    }
    
    // 取消点赞时的缩放动画
    &.unliked {
      animation: scale-down 0.3s ease-in-out;
    }
    
    &.active {
      background: rgba(24, 144, 255, 0.06);
      color: #1890ff;
    }
  }
}

.commentSection {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
  animation: slide-down 0.3s ease-out;
}

/* 动画效果 */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-down {
  from {
    opacity: 0;
    max-height: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    max-height: 1000px;
    transform: translateY(0);
  }
}


/* 响应式设计 */
@media (max-width: 768px) {
  .content {
    .imageGrid {
      // 移动端最多显示2列
      &:has(.imageWrapper:nth-child(3):last-child),
      &:has(.imageWrapper:nth-child(n+5)) {
        grid-template-columns: 1fr 1fr;
      }
    }
  }
  
  .cardHeader {
    .userInfo {
      .username {
        font-size: 13px;  /* 调整为13px */
      }
    }
  }
  
  .content .text {
    font-size: 14px;
  }
}

/* 加载动画 */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* 心跳动画 */
@keyframes heart-beat {
  0% {
    transform: scale(1);
  }
  14% {
    transform: scale(1.3);
  }
  28% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.3);
  }
  70% {
    transform: scale(1);
  }
}

/* 缩放动画 */
@keyframes scale-down {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.8);
  }
  100% {
    transform: scale(1);
  }
}

.actionBtn:disabled {
  animation: pulse 1s infinite;
}